using Microsoft.AspNetCore.Mvc;
using My.Application.Contracts.Users;
using My.Application.Contracts.Issues;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Authentication;

namespace My.WebApi.Controllers
{
    [Authorize]
    [ApiController]
    [Route("[controller]")]
    public class WeatherForecastController : AbpController
    {
        private readonly IAccountUserService _accountUserService;
        private readonly IIssueService _issueService;
        private readonly Application.Orders.ITestInterface _testInterface;

        public WeatherForecastController(
            IAccountUserService accountUserService,
            IIssueService issueService,
            Application.Orders.ITestInterface testInterface)
        {
            _accountUserService = accountUserService;
            _issueService = issueService;
            _testInterface = testInterface;
        }

        [HttpPost]
        public async Task GetUser([FromBody] Application.Contracts.Issues.Dtos.IssueAssignDto input)
        {
            var context = HttpContext;
            var a = await context.GetTokenAsync("access_token");
            await _issueService.AssignAsync(input);
            //await _accountUserService.GetUser();
        }

        [AllowAnonymous]
        [HttpGet]
        public void PrintMessage([FromQuery] string message)
        {
            _testInterface.PrintMessage(message);
        }
    }
}